package http

import (
	//"github.com/go-kratos/kratos/pkg/log"
	bm "github.com/go-kratos/kratos/pkg/net/http/blademaster"

	//"dbagent/internal/conf"
	"dbagent/internal/server/http/middleware"
	//"dbagent/pkg/auth"
	//"dbagent/pkg/util"
)

func initRouter(e *bm.Engine) {
	// e.NoMethod(middleware.NoMethodHandler())
	// e.NoRoute(middleware.NoRouteHandler())

	// e.Use(middleware.UserAuthMiddleware(
	//	jwtAuth,
	//	middleware.AllowMethodAndPathPrefixSkipper(
	//		//添加token认证例外
	//		middleware.JoinRouter("GET", "/api/v1/login"),
	//	),
	// ))

	/*---------------------------公共接口-----------------------------------------------*/
	{
		command := e.Group("v1/command")
		command.Use(new(middleware.BasicAuth))
		command.POST("eval-script", EvalScripts)
		command.POST("eval-script-v2", EvalScriptsV2)
	}

	{
		router := e.Group("v1/mysql")
		//mysql备份相关
		router.POST("startNc", StartNc)
		router.POST("startFullBackup", StartFullBackup)
		router.POST("startRedoLog", StartRedoLog)
	}
}
